<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../js/vue/html.js"></script>
    <script src="../../js/vue/jquery/jquery.js"></script>
</head>
<body>
<div id="nb">
    <form id="formId">
        <input type="hidden" name="id">
        名称：<input type="text" name="name"><br>
        年龄：<input type="text" name="age"><br>
        <input type="button" id="btn" @click="submitForm()" value="提交"></input>
    </form>
</div>
<script>
    var vue = new Vue({
        el: "#nb",
        data:{},
        methods:{
            submitForm:function () {
                $.post("http://localhost:8888/employee/post",$("#formId").serialize(),function (data) {
                    if(data==200){
                        location.href="views/vue/vur-list.html"
                    }else {
                        console.log(data.msg)
                    }
                })
            }
        }
    })
</script>
</body>
</html>